.\"  Man page for pp2cf
.TH PP2CF "1" "November 2012" "Version 0.9.6" ""
.SH NAME
pp2cf \- PP to CF\-netCDF file converter
.SH SYNOPSIS
.B pp2cf [\-a opts] [\-d dir] [\-f format] [\-o outfile] [\-r opts] [\-t table] [\-u VN] [\-v] [\-V] FILE [FILE ...]
.SH DESCRIPTION
.\" Add any additional description here
.PP
Convert multiple PP files to a single CF-netCDF file or convert
multiple PP files to multiple CF-netCDF files on a file by file basis.
.PP
PP fields contributing to the same output netCDF file are aggregated
into as few multidimensional netCDF variables as possible using the
aggregation rules based on the CF data model. See
.I http://www.met.reading.ac.uk/~david/cf_aggregation_rules.html
.PP
The conversion is carried out internally using the python cf package
which must be installed. See
.I http://code.google.com/p/cf\-python
.PP
See
.I http://www.met.reading.ac.uk/~david/pp2cf.html
for more details and examples.
.TP
.B \-a options, \-\-aggregate_options=options
Customize the field aggregation process: The 'messages' option
controls whether to (1) or not to (0, the default) print information
messages on the aggregation process.

For example, \-a 'messages=1'
.TP
.B \-d dir, \-\-directory=dir
Create an output netCDF file for each PP file and place each output
file in this directory. If unset and the \-o option is also unset then
each netCDF file will be created in the same directory as its
corresponding PP file. In any case, each netCDF file will have the
same non\-directory portion of the PP file's path name, except with
the suffix '.nc'.
.TP
.B \-f format \-\-format=format
Set the netCDF format of the output file(s). Valid choices
are 'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_64BIT',
and 'NETCDF3_CLASSIC'. If unset then defauts to 'NETCDF3_CLASSIC'.
.TP
.B \-o outfile, \-\-output=outfile
Convert the contents of all PP files to this netCDF file. If unset
then an output netCDF file will be created for each PP file (see the
\-d option for details).
.TP
.B \-r options, \-\-read_options=options
Customize the reading of the input files: The 'squeeze' option
controls whether to remove all size 1 dimensions from the data array
(1, the default) or force the data array to span all size 1 dimensions
(-1); the 'ignore_ioerror' option controls whether to (1) or not to
(0) ignore unreadable files (default 0, the default); the 'aggregate'
option controls whether to (1, the default) or not to (0) aggregate
the input fields (default 1).

For example, \-r 'squeeze=-1, ignore_ioerror=1'
.TP
.B \-t table, \-\-table=table
Provide a different PP STASH code to CF standard_name conversion
table. The default table is the file 'etc/STASH_to_CF.txt' located in
the cf\-python installation directory. The most up to date version of
the table may be found at
.I http://puma.nerc.ac.uk/STASH_to_CF/STASH_to_CF.txt
.TP
.B \-u VN, \-\-umversion=VN
Use this UM version when translating PP STASH codes to CF standard
names. If unset then the UM version is taken from the environment
variable UMVERSION. In either case, if a PP field specifies a UM
version in its header then this will be used in preference.
.TP
.B \-v, \-\-verbose
Verbose. Display a summary of newly created netCDF files.
.TP
.B \-V, \-\-Version
Display the version.
.SH EXAMPLES
.nf
man pp2cf

.nf
pp2cf file.pp
.fi

.nf
pp2cf \-o output.nc file.pp
.fi

.nf
pp2cf \-d directory file.pp
.fi

.nf
pp2cf *.pp
.fi

.nf
pp2cf \-u 7.6 file1.pp file2.pp
export UMVERSION=7.6
pp2cf file1.pp file2.pp
.fi

.nf
pp2cf \-f NETCDF4 \-t user_table.txt \-v directory/file*.pp
.fi

.nf
pp2cf \-a messages=1 -r "squeeze=\-1, ignore_ioerror=1" file*.pp
.fi

.nf
pp2cf \-V
.fi
.SH AUTHOR
Written by David Hassell.
.SH LICENSE
Open Source Initiative MIT License. See
.I http://www.opensource.org/licenses/mit-license.php
.SH BUGS
The author would welcome reports of bugs at
.I http://code.google.com/p/cf\-python/issues/list
